//
//  JXTempController.m
//  JiaoX
//
//  Created by jiaoxiu－004 on 14-10-11.
//  Copyright (c) 2014年 北京娇羞科技有限公司. All rights reserved.
//

#import "JXTempController.h"
#import "JXGuideController.h"

@interface JXTempController ()<UIWebViewDelegate>
@property (nonatomic,strong) UIWebView *webview;
@end

@implementation JXTempController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = _navtitle;
    
    
    //初始化webview
    _webview = [[UIWebView alloc]init];
    _webview.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    [self.view addSubview:_webview];
    _webview.delegate = self;
    
    _webview.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"LaunchImage"]];
    //加载数据
    [_webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_url]]];
    
}



-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    //返回yes会继续去加载网页，返回No不会去继续加载网页
    return [Utils dealWebViewUrlWithController:self url:[request.URL absoluteString] title:@""];
}

-(void)dealloc{
    self.webview.delegate = nil;
    [self.webview stopLoading];
}








-(void)next{
    JXGuideController *newVc = [[JXGuideController alloc] init];
//    newVc.view.backgroundColor = [UIColor redColor];
    newVc.title = @"新控制器";
    [self.navigationController pushViewController:newVc animated:YES];
}



@end
